<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>
  <script>
    if (confirm('您确认要执行此操作？')) {
      alert('用户确认');
    } else {
      alert('用户取消');
    }
  </script>
</body>
</html>